import request from '@/utils/request'

// 查询收购票据列表
export function listPurchaseOrderTicket(query) {
  return request({
    url: '/console/oms/purchaseOrderTicket/list',
    method: 'get',
    params: query
  })
}

// 查询收购票据详细
export function getPurchaseOrderTicket(id) {
  return request({
    url: '/console/oms/purchaseOrderTicket/' + id,
    method: 'get'
  })
}

// 新增收购票据
export function addPurchaseOrderTicket(data) {
  return request({
    url: '/console/oms/purchaseOrderTicket',
    method: 'post',
    data: data
  })
}

// 创建收购票据
export function addPurchaseOrderTicketPurchaseMerge(data) {
  return request({
    url: '/console/oms/purchaseOrderTicket/purchaseMerge',
    method: 'post',
    data: data
  })
}

// 撤销上一次结算
export function revokeLastStatement(data) {
  return request({
    url: '/console/oms/purchaseOrderTicket/revokeLastStatement',
    method: 'post',
    data: data
  })
}

// 修改收购票据
export function updatePurchaseOrderTicket(data) {
  return request({
    url: '/console/oms/purchaseOrderTicket',
    method: 'put',
    data: data
  })
}

// 删除收购票据
export function delPurchaseOrderTicket(id) {
  return request({
    url: '/console/oms/purchaseOrderTicket/' + id,
    method: 'delete'
  })
}

// 导出收购票据
export function exportPurchaseOrderTicket(query) {
  return request({
    url: '/console/oms/purchaseOrderTicket/export',
    method: 'get',
    params: query
  })
}
